#ifndef HUD_TEXT_H
#define HUD_TEXT_H
#include "../core/screen.h"
#include "../affiliate/text_label.h"
#include "../affiliate/sprite.h"
class hudText : public screen {
protected:
    textLabel* label;
    sprite* bg;
    glm::vec2 size;
public:
    static hudText* createHUDText(node* parent,const char* name, const char* text, glm::vec2 render_pos,glm::vec2 size, 
        char* fontPath = "assets/font/VonwaonBitmap-16px.ttf", 
        int fontSize = 32, const char* bgPath = "assets/UI/Textfield_01.png",
        Anchor anchor = Anchor::ANCHOR_CENTER);
    void setTextLabel(textLabel* label_) {this->label = label_;}
    void setBg(sprite* bg_) {this->bg = bg_; }
    textLabel* getTextLabel() {return this->label;}
    sprite* getBg() {return this->bg;}
    void setText(const char* text) {this->label->setText(text);}
    const char* getText()const {return this->label->getText();}
    void setBackground(const char* path);
    void setSize(glm::vec2 size_);
    void setBgSizeByText(float margin = 50.0f); 
};
#endif // HUD_TEXT_H